<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ page import="org.apache.shiro.authc.ExcessiveAttemptsException"%>
<%@ page import="org.apache.shiro.authc.IncorrectCredentialsException"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html>
<head>
	<title>登录页</title>
	 <%@ include file="/WEB-INF/layouts/v2/mete_v2.jsp"%>
	  
</head>

<body style="background: #f3f3f3" >
<div style="height: 400px;left: 50%;margin: -200px auto 0 -200px;position: absolute;top: 30%;width: 400px;">
  <div class="form-box" id="login-box" >
<div class="header bg-blue"><img src="${ctx}/static/v2/img/wms-login.png"></div>
	<form id="loginForm" action="${ctx}/v2/login" method="post" class="form-horizontal">
	<%
	String error = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
	if(error != null){
	%>
	<div class="alert alert-warning alert-dismissable">
	<i class="fa fa-warning"></i>
	<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
	<b>提示!</b>
	登录失败，请重试.
	</div>
	<%
	}
	%>
    <div class="body bg-gray">
         <div class="form-group">
             <input type="text" id="username" name="username" class="form-control required" value="${username}"  placeholder="用户名"/>
         </div>
         <div class="form-group">
             <input type="password" id="password" name="password" class="form-control required" placeholder="密码"/>
         </div>          
         <div class="form-group">
             <input type="checkbox" name="rememberMe"/> 记住我
         </div>
     </div>
     <div class="footer">                                                               
       <button type="submit" class="btn bg-blue btn-block margin-top-10">登录</button>
      </div>  
                    
		<%-- 
		<div class="control-group">
			<div class="controls">
				<label class="checkbox" for="rememberMe"><input type="checkbox" id="rememberMe" name="rememberMe"/> 记住我</label>
				<input id="submit_btn" class="btn btn-warning" type="submit" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;登录&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/>
				<!-- <input  class="btn btn-info" value="商家授权" style="width: 80px;" onclick="openTopisv();"/> -->
			</div>
		</div> --%>
	</form>
    </div>
  </div>
  <script type="text/javascript">
		 $(function() {
			$("#loginForm").validate();
			if("${param.kickout}" == 1){
				jAlert("您的账号已在别处登陆,请注意保管您的账号密码!","重要提醒");
			}
		});
		
		function openTopisv() {
        
	        var codeUrl="https://oauth.taobao.com/authorize";
	        var appKey="23009731";
	        var recallUrl="http://top.paiu.com.cn/wms/v2_auth/code";
	        
	        
	        //测试账号：sandbox_b_01
	        //测试账号密码：taobao1234
	        
			var tempString = codeUrl
					+ "?response_type=code"
					+"&client_id="+ appKey
					+ "&redirect_uri="+recallUrl
					+"&state=state";
			//window.open(tempString, "", "", "");
			location.href=tempString;
		}
	</script>
</body>
</html>
